import React, { useContext } from "react";
import context from "@/context";
const { ColorContext } = context;

export default function ShowColors() {
    // let { color } = useContext(ColorContext);
    return (
        <ColorContext.Consumer>
            {({ color }) => (
                <div>
                    reducer中颜色是<span style={{ color }}>{color}</span>
                </div>
            )}
        </ColorContext.Consumer>
        // <div>reducer中颜色是<span style={{ color }}>{color}</span></div>
    );
}
